# python 里面异常类是一棵树形结构,最顶层的异常类叫BaseException
# 子类能捕获的异常,父类也能捕获

try:
    print('try...')
    r = 10 / 0
except ZeroDivisionError as e:
    print('除零错误1:', e)
    # 子类能捕获的异常,父类也能捕获,先出现的分支,会优先匹配
    # 建议: 如果子类和父类同时出现,建议先处理子类异常,再处理父类异常
except Exception as e:
    print('除零错误2:', e)

